#
# date: 13:39 2011-2-16
# author: bianpeng<proudou@gmail.com>
#
.PHONY: clean

PROJECT = al_game

CC = cl
LINK = link
RM = del

CFLAGS = /c /EHs /nologo /MT /Zi
IPATH = /Id:\works\opensource\kenai\v8\include 		\
	/Id:\works\opensource\v8\include				\
	/Id:\works\opensource\allegro5.0\include		\
	/I"D:\Program Files\Microsoft DirectX SDK (June 2010)\Include"

LFLAGS = /nologo /debug /subsystem:windows /out:${PROJECT}.exe
LPATH = /LIBPATH:. /LIBPATH:d:\works\opensource\allegro5.0\lib \
	/LIBPATH:"D:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86"
	
#
LIBS = user32.lib kernel32.lib v8.lib d3d9.lib d3dx9.lib dinput8.lib	\
	allegro.lib	\
	allegro_acodec.lib	\
	allegro_audio.lib	\
	allegro_color.lib	\
	allegro_dialog.lib	\
	allegro_font.lib	\
	allegro_image.lib	\
	allegro_main.lib	\
	allegro_memfile.lib	\
	allegro_primitives.lib
	
#	object files
OBJS = main.obj

$(PROJECT).exe: $(OBJS)
	$(LINK) $(LFLAGS) $(LPATH) $(LIBS) $^

$(PROJECT).pch: al_game_pch.h al_game_pch.cpp
	$(CC) $(CFLAGS) $(IPATH) /Ycal_game_pch.h /Fp$(PROJECT).pch al_game_pch.cpp

%.obj: %.cpp $(PROJECT).pch
	$(CC) $(CFLAGS) $(IPATH) /Yual_game_pch.h /Fp$(PROJECT).pch $<

clean_all: clean
	$(RM) *.pch *.pdb *.ilk *.dblite 

clean:
	$(RM) *.exe *.obj *~



